# Contributor: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me>
# Maintainer: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me>
pkgname=py3-markdown-include
_pkgreal=markdown-include
pkgver=0.8.1
pkgrel=1
pkgdesc="A Python-Markdown extension which provides an 'include' function"
url="https://github.com/cmacmackin/markdown-include"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-markdown"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgreal:0:1}/$_pkgreal/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4ae155d7e114de9d8ca32c129fe5778e7fc9516321357d8e4d90fad651a1dcb54b1fb144bc51e981cf728f1632dc293ed8cc1e7d4219154a2350780ea6f9b7b2  markdown-include-0.8.1.tar.gz
"
